package com.example.demo.service.impl;

import com.example.demo.entity.Student;
import com.example.demo.mapper.StudentMapper;
import com.example.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    public List<Student> findAll() {
        return studentMapper.findAll();
    }
    @Override
    public void delete(String sid) {
        studentMapper.delete(sid);
    }
    @Override
    public void modify(String sid, String name, int age, String gender, Date birthday) {
        studentMapper.update(name, age, gender, birthday, sid);
    }
    @Override
    public void add(String sid, String name, int age, String gender, Date birthday) {
        studentMapper.add(sid, name, age, gender, birthday);
    }
}
